package com.buanalintas.sandals.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "pos_transaction_receipt")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionReceipt.findAll", query = "SELECT t FROM PosTransactionReceipt t"),
//    @NamedQuery(name = "PosTransactionReceipt.findBySync", query = "SELECT t FROM PosTransactionReceipt t WHERE t.sync = :sync"),
//    @NamedQuery(name = "PosTransactionReceipt.findByReceiptId", query = "SELECT t FROM PosTransactionReceipt t WHERE t.receiptId = :receiptId"),
//    @NamedQuery(name = "PosTransactionReceipt.findByReceiptNumber", query = "SELECT t FROM PosTransactionReceipt t WHERE t.receiptNumber = :receiptNumber"),
//    @NamedQuery(name = "PosTransactionReceipt.findByReceiptDate", query = "SELECT t FROM PosTransactionReceipt t WHERE t.receiptDate = :receiptDate"),
//    @NamedQuery(name = "PosTransactionReceipt.findByReceiptTimestamp", query = "SELECT t FROM PosTransactionReceipt t WHERE t.receiptTimestamp = :receiptTimestamp")})
public class PosTransactionReceipt implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private Integer sync;
    @Id
    @Basic(optional = false)
    @Column(name = "receipt_id")
    private Integer receiptId;
    @Basic(optional = false)
    @Column(name = "receipt_number")
    private String receiptNumber;
    @Basic(optional = false)
    @Column(name = "receipt_purchase_order_total_quantity")
    private Integer receiptPurchaseOrderTotalQuantity;
    @Basic(optional = false)
    @Column(name = "receipt_purchase_order_received")
    private Integer receiptPurchaseOrderReceived;
    @Basic(optional = false)
    @Column(name = "receipt_purchase_order_add")
    private Integer receiptPurchaseOrderAdd;
    @Basic(optional = false)
    @Column(name = "receipt_retur_quantiy")
    private Integer receiptReturQuantity;
    @Basic(optional = false)
    @Column(name = "receipt_purchase_order_progress")
    private String receiptPurchaseOrderProgress;
    @Basic(optional = false)
    @Column(name = "receipt_date")
    @Temporal(TemporalType.DATE)
    private Date receiptDate;
    @Basic(optional = false)
    @Column(name = "receipt_total")
    private BigDecimal receiptTotal;
    @Basic(optional = false)
    @Column(name = "receipt_paid")
    private BigDecimal receiptPaid;
    @Basic(optional = false)
    @Column(name = "receipt_keel")
    private String receiptKeel;
    @Basic(optional = false)
    @Column(name = "receipt_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date receiptTimestamp;
    @Basic(optional = false)
    @Lob
    @Column(name = "receipt_description")
    private String receiptDescription;
    @JoinColumn(name = "receipt_unit_id", referencedColumnName = "unit_id")
    @ManyToOne(optional = false)
    private MasterUnit receiptUnitId;
    @JoinColumn(name = "receipt_user_id", referencedColumnName = "user_id")
    @ManyToOne(optional = false)
    private MasterUser receiptUserId;
    @JoinColumn(name = "receipt_purchase_order_id", referencedColumnName = "purchase_order_id")
    @ManyToOne(optional = false)
    private PosTransactionPurchaseOrder receiptPurchaseOrderId;

    public PosTransactionReceipt() {
    }

    public PosTransactionReceipt(Integer receiptId) {
        this.receiptId = receiptId;
    }

//    public PosTransactionReceipt(Integer receiptId, String receiptNumber, Date receiptDate, Date receiptFirstGiroDate, Date receiptSecondGiroDate, BigDecimal receiptTotal, BigDecimal receiptPaid, String receiptKeel, Date receiptTimestamp, String receiptDescription) {
//        this.receiptId = receiptId;
//        this.receiptNumber = receiptNumber;
//        this.receiptDate = receiptDate;
//        this.receiptTotal = receiptTotal;
//        this.receiptPaid = receiptPaid;
//        this.receiptKeel = receiptKeel;
//        this.receiptTimestamp = receiptTimestamp;
//        this.receiptDescription = receiptDescription;
//    }

    public Date getReceiptDate() {
        return receiptDate;
    }

    public void setReceiptDate(Date receiptDate) {
        this.receiptDate = receiptDate;
    }

    public String getReceiptDescription() {
        return receiptDescription;
    }

    public void setReceiptDescription(String receiptDescription) {
        this.receiptDescription = receiptDescription;
    }

    public Integer getReceiptId() {
        return receiptId;
    }

    public void setReceiptId(Integer receiptId) {
        this.receiptId = receiptId;
    }

    public String getReceiptNumber() {
        return receiptNumber;
    }

    public void setReceiptNumber(String receiptNumber) {
        this.receiptNumber = receiptNumber;
    }

    public PosTransactionPurchaseOrder getReceiptPurchaseOrderId() {
        return receiptPurchaseOrderId;
    }

    public void setReceiptPurchaseOrderId(PosTransactionPurchaseOrder receiptPurchaseOrderId) {
        this.receiptPurchaseOrderId = receiptPurchaseOrderId;
    }

    public Integer getReceiptPurchaseOrderTotalQuantity() {
        return receiptPurchaseOrderTotalQuantity;
    }

    public void setReceiptPurchaseOrderTotalQuantity(Integer receiptPurchaseOrderTotalQuantity) {
        this.receiptPurchaseOrderTotalQuantity = receiptPurchaseOrderTotalQuantity;
    }

    public Integer getReceiptPurchaseOrderReceived() {
        return receiptPurchaseOrderReceived;
    }

    public void setReceiptPurchaseOrderReceived(Integer receiptPurchaseOrderReceived) {
        this.receiptPurchaseOrderReceived = receiptPurchaseOrderReceived;
    }

    public Integer getReceiptPurchaseOrderAdd() {
        return receiptPurchaseOrderAdd;
    }

    public void setReceiptPurchaseOrderAdd(Integer receiptPurchaseOrderAdd) {
        this.receiptPurchaseOrderAdd = receiptPurchaseOrderAdd;
    }

    public Integer getReceiptReturQuantity() {
        return receiptReturQuantity;
    }

    public void setReceiptReturQuantity(Integer receiptReturQuantity) {
        this.receiptReturQuantity = receiptReturQuantity;
    }

    public String getReceiptPurchaseOrderProgress() {
        return receiptPurchaseOrderProgress;
    }

    public void setReceiptPurchaseOrderProgress(String receiptPurchaseOrderProgress) {
        this.receiptPurchaseOrderProgress = receiptPurchaseOrderProgress;
    }

    public String getReceiptKeel() {
        return receiptKeel;
    }

    public void setReceiptKeel(String receiptKeel) {
        this.receiptKeel = receiptKeel;
    }

    public BigDecimal getReceiptPaid() {
        return receiptPaid;
    }

    public void setReceiptPaid(BigDecimal receiptPaid) {
        this.receiptPaid = receiptPaid;
    }

    public BigDecimal getReceiptTotal() {
        return receiptTotal;
    }

    public void setReceiptTotal(BigDecimal receiptTotal) {
        this.receiptTotal = receiptTotal;
    }

    public Date getReceiptTimestamp() {
        return receiptTimestamp;
    }

    public void setReceiptTimestamp(Date receiptTimestamp) {
        this.receiptTimestamp = receiptTimestamp;
    }

    public MasterUnit getReceiptUnitId() {
        return receiptUnitId;
    }

    public void setReceiptUnitId(MasterUnit receiptUnitId) {
        this.receiptUnitId = receiptUnitId;
    }

    public MasterUser getReceiptUserId() {
        return receiptUserId;
    }

    public void setReceiptUserId(MasterUser receiptUserId) {
        this.receiptUserId = receiptUserId;
    }

    public Integer getSync() {
        return sync;
    }

    public void setSync(Integer sync) {
        this.sync = sync;
    }
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (receiptId != null ? receiptId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof PosTransactionReceipt)) {
            return false;
        }
        PosTransactionReceipt other = (PosTransactionReceipt) object;
        if ((this.receiptId == null && other.receiptId != null) || (this.receiptId != null && !this.receiptId.equals(other.receiptId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return receiptNumber;
    }
}
